package com.example.myapplication;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

public class Pe {
public static class PeopleAdapter extends RecyclerView.Adapter<PeopleAdapter.ViewHolder>{


String[] names;
public PeopleAdapter(String[] names){
    this.names = names;
}




    static class ViewHolder extends RecyclerView.ViewHolder{
        TextView Text_one;


        public ViewHolder(@NonNull View itemView) {
            super(itemView);
            Text_one = itemView.findViewById(R.id.textView2);
        }
    }
    @NonNull
    @Override
    public PeopleAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).
                inflate(R.layout.name_one,parent,false);
        ViewHolder viewHolder = new ViewHolder(view);
        return viewHolder;

    }

    @Override
    public void onBindViewHolder(@NonNull PeopleAdapter.ViewHolder holder, int position) {
holder.Text_one.setText(names[position]);
    }

    @Override
    public int getItemCount() {
        return names.length;
    }
}



}
